package com.cq.hd.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cq.hd.member.api.dto.UserPointsAccountPageDto;
import com.cq.hd.member.api.vo.UserPointsAccountPageVo;
import com.cq.hd.member.po.TbUserPointsAccountPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface TbUserPointsAccountMapper extends BaseMapper<TbUserPointsAccountPo> {
    TbUserPointsAccountPo getAccount(@Param("businessId") Long businessId, @Param("userId") Long userId);

    // 调整积分余额
    Boolean businessChangePoints(@Param("id") Long id, @Param("points") BigDecimal points, @Param("originPoints") BigDecimal originPoints);

    // 用户积分列表
    List<UserPointsAccountPageVo> listUserPointsAccountByDto(UserPointsAccountPageDto userPointsAccountPageDto);

    // 用户积分详情
    UserPointsAccountPageVo getUserPointsAccount(@Param("businessId") Long businessId, @Param("userId") Long userId);
}
